<#escape x as (x)!?html>
    <#import "/page/synxisadapter/EnumUtils.ftl" as enumUtils/>
<head>
    <script type="text/javascript">
        var menuId = "Settings_Hotel";

        function update(e) {

            if (!validateInputs($("#mainForm"))) {
                return;
            }

            $.ajax({
                type: "POST",
                url: "edit!ajaxSubmit.action",
                data:  $("#mainForm").serialize(),
                dataType :"json",
                success: function(echo) {
                    if (echo.result == true) {
                        showTip(e, "Save success！");
                    } else {
                        showTip(e, echo.result);
                    }
                },
                async: false
            });
        }
    </script>
</head>
<body>

<form id="mainForm">
    <fieldset>
        <legend>
            <span class="title">Hotel Information</span>
        </legend>
        <table class="property_table">
            <tr>
                <td class="key">SynXis ID:</td>
                <td class="value">
                    <input type="text" class="longText" name="id"
                           validator="notEmpty" value="${id}" readonly
                           style="background-color:#aaa"/>
                </td>
            </tr>
            <tr>
                <td class=" key">Passport:</td>
                <td class="value">
                    <input type="text" class="longText" name="passport" validator="notEmpty" value="${passport}"/>
                </td>
            </tr>
            <tr>
                <td class=" key">Name:</td>
                <td class="value">
                    <input type="text" class="longText" name="name" validator="notEmpty" value="${name}"/>
                </td>
            </tr>
            <tr>
                <td class=" key">ProviderPassport:</td>
                <td class="value">
                    <input type="text" class="longText" name="providerPassport" validator="notEmpty"
                           value="${providerPassport}"/>
                </td>
            </tr>
            <tr>
                <td class=" key">ProviderName:</td>
                <td class="value">
                    <input type="text" class="longText" name="providerName" validator="notEmpty"
                           value="${providerName}"/>
                </td>
            </tr>
            <tr>
                <td class=" key">Status:</td>
                <td class="value">
                    <select class="select" name="status">
                        <#list enumUtils.enumHotelStatus() as it>
                            <option value="${it}" ${(status==it)?string("selected='selected'","")}>${it}</option>
                        </#list>
                    </select>
                </td>
            </tr>
        </table>
    </fieldset>

    <input type="button" value="Save" class="btn" onclick="update($(this))"/>
    <input type="button" value="Back" class="btn" onclick="window.location.href='query.action'"/>
</form>
</body>
</#escape>